﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SysCode.aspx.cs" Inherits="WMS6.Web.Administration.SysCode"
    meta:resourcekey="Page" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>SysCode</title>
    <link href="../style/zh/1/css.css" type="text/css" rel="Stylesheet" id="mycss" />
    <link href="../Css/style.css" type="text/css" rel="stylesheet" />

    <script src="../Js/jquery.js" type="text/javascript"></script>

    <script src="../Js/jquery.simplemodal.js" type="text/javascript"></script>

    <script src="../Js/util.js" id="js" type="text/javascript"></script>

    <script src="../Js/InitPage.js" type="text/javascript"></script>

    <script src="../Js/checkbox.js" type="text/javascript"></script>

    <script type="text/javascript">
        //初始化页面
        window.onload = function() {
            initEditNewPage();
        }

        function newSysCode() {
            var from = document.getElementById("hdnFrom").value;
            window.location.href = "SysCode.aspx?from=" + escape(from);
            return false;
        }
        function AddSysCodeDetail() {
            window.location.href = "SysCodeDetail.aspx?ID=" + escape(document.getElementById('txtSysCodeType').value)+"&from="+escape(document.getElementById("hdnFrom").value);
            return false;
        }
        function confirmMsg(code) {
            if (code == "F1800_012") {
                if (confirm('<%=GetGlobalMsgResource("F1800_012") %>')) {
                    return true;
                }
                else {
                    return false;
                }
            }
        }
    </script>

</head>
<body>
    <form id="F1081" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div id="div_top">
            <table>
                <tr>
                    <td valign="bottom">
                        <asp:Label ID="lblOwner" runat="server" CssClass="label_header" Text="系统代码" meta:resourcekey="lblOwner"></asp:Label>
                    </td>
                    <td>
                        <asp:Button ID="btnGoBack" runat="server" CssClass="button" Enabled="False" Text="<%$Resources:ButtonResource,btnGoBack%>"
                            OnClick="btnGoBack_Click" meta:resourcekey="btnGoBack" />
                    </td>
                    <td>
                        <asp:Button ID="btnNew" runat="server" Enabled="False" Visible="False" CssClass="button"
                            Text="<%$Resources:ButtonResource,btnNew%>" AccessKey="n" OnClientClick="newSysCode();" />
                    </td>
                    <td>
                        <asp:Button ID="btnSave" runat="server" CssClass="button" Enabled="False" Text="<%$Resources:ButtonResource,btnSave%>"
                            AccessKey="s" OnClick="btnSave_Click" />
                    </td>
                    <td>
                        <asp:Button ID="btnDelete" runat="server" CssClass="button" Enabled="False" Text="<%$Resources:ButtonResource,btnDelete%>"
                            AccessKey="d" OnClientClick="javascript:if(confirmMsg('F1800_012')) return true; else return false;"
                            OnClick="btnDelete_Click" />
                    </td>
                    <td>
                        <asp:Button ID="btnCopy" runat="server" CssClass="button" Enabled="False" Text="<%$Resources:ButtonResource,btnCopy%>"
                            AccessKey="c" OnClick="btnCopy_Click" />
                    </td>
                </tr>
            </table>
        </div>
        <asp:UpdatePanel ID="up1" runat="server">
            <ContentTemplate>
                <div>
                    <asp:Label ID="lblMsg" runat="server" CssClass="label_message" meta:resourcekey="lblMsg"></asp:Label>
                </div>
                <div id="div_menu">
                    <div style="float: left; width: 8px;">
                        <div class="tabL" id="divL1">
                        </div>
                    </div>
                    <div style="float: left;" class="tabLabelCont tabCur" onclick="setTab('one',1,2)"
                        id="divM1">
                        <asp:Label ID="one1" CssClass="hover" runat="server" meta:resourcekey="one1">常规</asp:Label></div>
                    <div style="float: left; margin-right: 2px;">
                        <div class="tabR" id="divR1">
                        </div>
                    </div>
                    <div style="float: left; width: 8px;">
                        <div class="tabL_1" id="divL2">
                        </div>
                    </div>
                    <div style="float: left;" class="tabLabelCont tabCur_1" onclick="setTab('one',2,2)"
                        id="divM2">
                        <asp:Label ID="one2" CssClass="navigationlabel" runat="server" meta:resourcekey="one2">代码明细</asp:Label></div>
                    <div style="float: left; margin-right: 2px;">
                        <div class="tabR_1" id="divR2">
                        </div>
                    </div>
                </div>
                <div id="div_content">
                    <div id="con_one_1" style="display: block;">
                        <table width="500px;" style="display: block; margin-left: 10px; margin-top: 10px;">
                            <tr>
                                <td>
                                    <asp:Label ID="lblSysCodeType" CssClass="label" runat="server" Text="系统代码" meta:resourcekey="lblSysCodeType"></asp:Label><span
                                        class="must_input">*</span>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:TextBox ID="txtSysCodeType" runat="server" CssClass="textbox" meta:resourcekey="txtSysCodeType"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblDescription" CssClass="label" runat="server" Text="说明" meta:resourcekey="lblDescription"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:TextBox ID="txtDescription" runat="server" CssClass="textbox" meta:resourcekey="txtDescription"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:CheckBox ID="chkSysCreated" runat="server" Enabled="False" CssClass="checkbox"
                                        Text="系统创建" meta:resourcekey="chkSysCreated" />
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="con_one_2" style="display: none;">
                        <table>
                            <tr>
                                <td>
                                    <div style="margin-top: 10px; margin-left: 10px">
                                        <asp:Button ID="btnAddDetail" runat="server" CssClass="button" Enabled="False"
                                            Text="<%$Resources:ButtonResource,btnAddDetail%>" OnClick="btnAddDetail_Click" AccessKey="n" meta:resourcekey="btnAddDetail" />
                                        <asp:Button ID="btnDeleteDetail" runat="server" CssClass="button" Enabled="False"
                                            Text="<%$Resources:ButtonResource,btnDelete%>" AccessKey="s" OnClick="btnDeleteDetail_Click"
                                            meta:resourcekey="btnDeleteDetail" />
                                    </div>
                                </td>
                            </tr>
                            <tr style="height: 10px;">
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div id="div_List">
                                        <asp:GridView ID="gvSysCodeDetail" runat="server" AllowSorting="True" AutoGenerateColumns="False" 
                                            CssClass="gridview" Width="700px" DataKeyNames="SysCode,SysCodeType" OnRowDataBound="gvSysCodeDetail_RowDataBound"
                                            AllowPaging="True" OnPageIndexChanging="gvSysCodeDetail_PageIndexChanging" OnSorting="gvSysCodeDetail_Sorting" oninit="gvSysCodeDetail_Init" 
                                            meta:resourcekey="gvSysCodeDetail">
                                            <FooterStyle CssClass="GridViewFooterStyle" />
                                            <RowStyle CssClass="GridViewRowStyle" />
                                            <HeaderStyle CssClass="GridViewHeaderStyle" />
                                            <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                                            <Columns>
                                                <asp:BoundField HeaderText="序号" FooterText="序号" meta:resourcekey="No">
                                                    <ItemStyle CssClass="GridViewRowWidth_40" />
                                                </asp:BoundField>
                                                <asp:TemplateField meta:resourcekey="TemplateField">
                                                    <HeaderTemplate>
                                                        <asp:CheckBox ID="CheckBox1" runat="server" onclick="selectAll(this,'gvSysCodeDetail');"
                                                            meta:resourcekey="CheckBox1" />
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="chbSelect" runat="server" meta:resourcekey="chbSelect" />
                                                    </ItemTemplate>
                                                    <FooterTemplate>
                                                        <asp:CheckBox ID="CheckBox2" runat="server" onclick="selectAll(this,'gvSysCodeDetail');"
                                                            meta:resourcekey="CheckBox2" />
                                                    </FooterTemplate>
                                                    <HeaderStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_40" />
                                                    <ItemStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_40" />
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="代码" FooterText="代码" SortExpression="SysCode" meta:resourcekey="SysCode">
                                                    <ItemTemplate>
                                                        <asp:HyperLink ID="HyperLink1" runat="server" Text='<%# Eval("SysCode") %>' NavigateUrl='<%# FormatUrl("~/Administration/SysCodeDetail.aspx?from=list&ID={0}&SysCode="+Eval("SysCode").ToString(),Eval("SysCodeType").ToString()) %>'
                                                            Target="_self" CssClass="hyperlink" meta:resourcekey="HyperLink1"></asp:HyperLink>
                                                    </ItemTemplate>
                                                    <ItemStyle CssClass="GridViewRowWidth_200" />
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="Description" HeaderText="描述" FooterText="描述" SortExpression="Description"
                                                    meta:resourcekey="Description">
                                                    <ItemStyle CssClass="GridViewRowWidth_200" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="Remark" HeaderText="说明" FooterText="说明" SortExpression="Remark"
                                                    meta:resourcekey="Remark">
                                                    <ItemStyle CssClass="GridViewRowWidth_200" />
                                                </asp:BoundField>
                                            </Columns>
                                        </asp:GridView>
                                    </div>
                                    <div id="div_pager">
                                        <input id="hdnTotalPages" runat="server" type="hidden">
                                            <input id="hdnSortField" runat="server" type="hidden" value=" ROWID "></input>
                                            <input id="hdnSortDirection" runat="server" type="hidden" value=" ASC "></input>
                                        </input>
                                        </input> </input>
                                    </div>
                                </td>
                                <td>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <input type="hidden" id="hdnFlag" runat="server" value="0">
                    <input id="hdnSeqNo" runat="server" type="hidden"></input>
                </input>
                </input>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="btnAddDetail" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="btnDeleteDetail" EventName="Click" />
                <%--<asp:AsyncPostBackTrigger ControlID="btnDelete" EventName="Click" />--%>
                <asp:AsyncPostBackTrigger ControlID="btnNew" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="btnSave" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="btnCopy" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>
    </div>
    <input type="hidden" id="hdnFrom" runat="server" />
    </form>
</body>
</html>
